<form id="edit-form" class="form-horizontal" style="position:relative;background: #fff" role="form" data-toggle="validator" method="POST" action="">
    <!--script data-main="/assets/js/main" src="/assets/js/require.min.js"></script-->
    <!--script-- src="/assets/js/axios.min.js"></script-->
    <div class="panel-body">
        <div id="myTabContent" class="tab-content" >
            <div class="tab-pane fade active in" id="tabs_0">
                <input type="hidden" id="row" name="data" value='<?php echo json_encode($row);?>' />
                <input type="hidden" id="rel_type" name="data" value='{$rel_type}' />
                <input type="hidden" id="rel_id" name="data" value='{$rel_id}' />
                <input type="hidden" id="id" name="row[id]" value='{$row.id}' />

                <fieldset>
                    <legend>基本信息</legend>
                    <div class="form-group">
                        <label for="c-table_id" class="control-label col-xs-12 col-sm-2">事项名称:</label>
                        <div class="col-xs-12 col-sm-8" id="div-table_id">
                            <input type="hidden" id="table_id" name="row[table_id]" value='{$row.table_id}'/>
                            <div class="title">{$table_id_name}</div>
                        </div>
                    </div>
                </fieldset>
                <fieldset>
                    <legend>课程信息</legend>
                    <div class="form-group">
                        <label for="c-table_id" class="control-label col-xs-12 col-sm-2">课程名称:</label>
                        <div class="col-xs-12 col-sm-8" id="div-event_name">
                            <input type="text" id="event_name" name="row[event_name]" class="form-control" readonly value='{$row.event_name}'/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="c-ocourse_logo" class="control-label col-xs-12 col-sm-2">课程封面:</label>
                        <div class="col-xs-12 col-sm-8" id="div-school_logo" >
                            <div class="form-inline">
                                <img src="{$row.ocourse_logo}" id="c-event_logo" class="img-thumbnail" style="width:128px;height:128px">
                              </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="c-table_id" class="control-label col-xs-12 col-sm-2">课程内容:</label>
                        <div class="col-xs-12 col-sm-8" id="div-eval_content">
                            <textarea type="text" id="event_content" name="row[event_content]" class="form-control" style="height:128px" readonly disabled>{$row.event_content}</textarea>
                        </div>
                    </div>
                </fieldset>
                <fieldset>
                    <legend>班级信息</legend>
                    <div class="form-group">
                        <label for="c-classes_id" class="control-label col-xs-12 col-sm-2">班名:</label>
                        <div class="col-xs-12 col-sm-8" id="div-classes_id">
                            <input type="hidden" id="classes_id" name="row[classes_id]" value='{$row.table_id}'/>
                            <select name="row[classes_id]" id="c-classes_id" class="form-control" disabled></select>
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="c-ocation_id" class="control-label col-xs-12 col-sm-2">教室:</label>
                        <div class="col-xs-12 col-sm-8" id="div-ocation_id">
                            <input type="hidden" id="ocation_id" name="row[ocation_id]" value='{$row.ocation_id}'/>
                            <select name="row[ocation_id]" id="c-ocation_id" class="form-control">
                            </select>
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="c-date" class="control-label col-xs-12 col-sm-2">日期:</label>
                        <div class="col-xs-12 col-sm-8" id="div-date">
                            <div class="form-inline">
                                <input type="text" id="c-date" name="row[date]" value="{$row.date}"
                                       class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-tip="日期"
                                       data-rule=""/>
                            </div>
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="c-week" class="control-label col-xs-12 col-sm-2">周几:</label>
                        <div class="col-xs-12 col-sm-8" id="div-week">
                            <input type="text" id="c-week" name="row[week]" value="{$row.week}" class="form-control"
                                   title="week" placeholder="" data-rule="" data-tip="周几"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="c-start_time" class="control-label col-xs-12 col-sm-2">时段:</label>
                        <div class="col-xs-12 col-sm-8 heng" id="div-daytime">
                            <input type="text" id="c-start_time" name="row[start_time]" value="{$row.start_time}"
                                   class="form-control"/><span>到</span>
                            <input type="text" id="c-end_ime" name="row[end_time]" value="{$row.end_time}"
                                   class="form-control" value="{$row.end_time}"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="c-oindex" class="control-label col-xs-12 col-sm-2">课节:</label>
                        <div class="col-xs-12 col-sm-8" id="div-oindex">
                            <input type="text" id="c-oindex" name="row[class_index]" value="{$row.class_index}"
                                   class="form-control" title="oindex" placeholder="" data-rule="" data-tip="课节"/>
                        </div>
                    </div>
                </fieldset>
                <fieldset>
                    <legend>参数设置</legend>
                    <div class="form-group">
                        <label for="prechenkintime" class="control-label col-xs-12 col-sm-2">课前打卡时间:</label>
                        <div class="col-xs-12 col-sm-8" id="div-prechenkintime">
                            <input type="text" id="prechenkintime" name="row[prechenkintime]" class="form-control" value='{$row.prechenkintime}'/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="prechenkouttime" class="control-label col-xs-12 col-sm-2">课后打卡时间:</label>
                        <div class="col-xs-12 col-sm-8" id="div-prechenkouttime">
                            <input type="text" id="prechenkouttime" name="row[prechenkouttime]" class="form-control" value='{$row.prechenkouttime}'/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="evalstart" class="control-label col-xs-12 col-sm-2">评价开始时间:</label>
                        <div class="col-xs-12 col-sm-8" id="div-evalstart">
                            <input type="text" id="evalstart" name="row[evalstart]" class="form-control" value='{$row.evalstart}'/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="evalend" class="control-label col-xs-12 col-sm-2">评价结束时间:</label>
                        <div class="col-xs-12 col-sm-8" id="div-evalend">
                            <input type="text" id="evalend" name="row[evalend]" class="form-control" value='{$row.evalend}'/>
                        </div>
                    </div>
                </fieldset>
                <fieldset id="app">
                    <legend>老师模式</legend>
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">老师岗:</label>
                        <div class="col-xs-12 col-sm-8" id="div-teacher">
                            <teacher-box :type="''" :left-options="leftOptions" :right-options="rightOptions"></teacher-box>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">管理岗:</label>
                        <div class="col-xs-12 col-sm-8" id="div-manger">
                            <manager-box :type="''" :left-options="leftOptions" :right-options="rightOptions"></manager-box>
                        </div>
                    </div>
                </fieldset>
                <fieldset>
                    <legend>教学点</legend>
                    <div class="form-group">
                        <label for="c-addresslv_id_A" class="control-label col-xs-12 col-sm-2">一级教学点:</label>
                        <div class="col-xs-12 col-sm-8" id="div-addresslv_id_A">
                            <input type="text" id="c-addresslv_id_A"  class="form-control" name="row[addresslv_id_A]" value='{$row.addresslv_id_A}'readonly/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="c-addresslv_id_B" class="control-label col-xs-12 col-sm-2">二级教学点:</label>
                        <div class="col-xs-12 col-sm-8" id="div-addresslv_id_B">
                            <input type="text" id="c-addresslv_id_B"  class="form-control" name="row[addresslv_id_B]" value='{$row.addresslv_id_B}' readonly />
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="c-address" class="control-label col-xs-12 col-sm-2">上课地点:</label>
                        <div class="col-xs-12 col-sm-8" id="div-address">
                            <input type="text" id="c-address" name="row[address]" class="form-control" value='{$row.address}' />
                        </div>
                    </div>
                </fieldset>
                <fieldset>
                    <legend>课堂信息</legend>
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">课堂类型:</label>
                        <div class="col-xs-12 col-sm-8" id="div-course_type">
                            {if $admin.group_id==3 || $admin.group_id==2|| $admin.group_id==1}
                            <label for="row[course_type]-1"><input id="row[course_type]-1" name="row[course_type]"
                                                              readonly disabled     type="radio" value="1" {if 1=="1"}checked{/if}/> 学校课堂</label>{/if}
                            {if $admin.group_id==8 || $admin.group_id==2|| $admin.group_id==1}
                            <label for="row[course_type]-2"><input id="row[course_type]-2" name="row[course_type]"
                                                                   readonly disabled              type="radio" value="2" {if 2=="1"}checked{/if}/> 社区课堂</label>{/if}

                            <label for="row[course_type]-3"><input id="row[course_type]-3" name="row[course_type]"
                                                                   readonly disabled              type="radio" value="3" {if 3=="1"}checked{/if}/> 校外课堂</label>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="c-subjectlv_id_A" class="control-label col-xs-12 col-sm-2">一级学科:</label>
                        <div class="col-xs-12 col-sm-8" id="div-subjectlv_id_A">
                            <input type="text" id="c-subjectlv_id_A"  class="form-control" name="row[subjectlv_id_A]" value='{$row.subjectlv_id_A}' readonly/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="c-subjectlv_id_B" class="control-label col-xs-12 col-sm-2">二级学科:</label>
                        <div class="col-xs-12 col-sm-8" id="div-subjectlv_id_B">
                            <input type="text" id="c-subjectlv_id_B"  class="form-control" name="row[subjectlv_id_B]" value='{$row.subjectlv_id_B}' readonly/>
                        </div>
                    </div>
                </fieldset>

                <fieldset>
                    <legend>课程日期筛选</legend>
                    <div class="form-group">
                        <label for="c-ocourse_conut" class="control-label col-xs-12 col-sm-2">课程长度:</label>
                        <div class="col-xs-12 col-sm-8" id="div-ocourse_conut" >
                            <input type="number" id="c-ocourse_conut" name="row[ocourse_conut]" value="{$row.ocourse_conut}" class="form-control" title="ocourse_conut" data-rule="require num" data-rule-num="[/^[0-9\.]+$/, '只能填入数值']" placeholder="只能填入数值"  data-tip="课程长度" disabled />
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="c-ocourse_conut" class="control-label col-xs-12 col-sm-2">一周几次课:</label>
                        <div class="col-xs-12 col-sm-8" id="div-classes_per_week" >
                            <input type="number" id="c-classes_per_week" name="row[classes_per_week]" value="{$row.classes_per_week}" class="form-control" title="ocourse_conut" data-rule="require num" data-rule-num="[/^[0-9\.]+$/, '只能填入数值']" placeholder="只能填入数值"  data-tip="课程长度" disabled />
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="c-ocourse_conut" class="control-label col-xs-12 col-sm-2">时点:</label>
                        <div class="col-xs-12 col-sm-8 heng" >
                            <input type="text" id="c-week" name="row[week]" value="{$row.week}" class="form-control" data-rule="require" style="width:55px" disabled />
                            <input type="text" id="c-daytime" name="row[daytime]" value="{$row.daytime}" class="form-control" data-rule="require"  style="width:55px" disabled />
                            <span>第</span><input type="text" id="c-oindex" name="row[oindex]" value="{$row.oindex}" class="form-control" data-rule="require"  style="width:55px" disabled /><span>节课</span>
                            <span>上课时间</span><input type="text" id="c-start_time" name="row[start_time]" value="{$row.start_time}" class="form-control" data-rule="require "  style="width:60px" disabled /><span>到</span>
                            <input type="text" id="c-end_time" name="row[end_time]" value="{$row.end_time}" class="form-control" data-rule="require "  style="width:60px" disabled />
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="c-ocourse_conut" class="control-label col-xs-12 col-sm-2">起始日期:</label>
                        <div class="col-xs-12 col-sm-8 heng" >
                            <input type="text" id="c-start_date" name="row[start_date]" value="{$row.start_date}" class="form-control" data-rule="require"  disabled />
                            <span>到</span><input type="text" id="c-end_date" name="row[end_date]" value="{$row.end_date}" class="form-control" data-rule="require"  disabled />
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="c-ocourse_conut" class="control-label col-xs-12 col-sm-2">是否排除国际假日:</label>
                        <div class="col-xs-12 col-sm-8 heng" >
                            <input type="checkbox" id="c-exclint_holidays" name="row[exclint_holidays]" {if $row.exclint_holidays=="1"}checked{/if} data-rule="require"  disabled />
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="c-same_classroom" class="control-label col-xs-12 col-sm-2">是否同一间教室:</label>
                        <div class="col-xs-12 col-sm-8" id="div-same_classroom" ><input  class="c-switch" id="c-same_classroom" name="row[same_classroom]" type="hidden" value="{$row.same_classroom}">
                            <a href="javascript:;" data-toggle="switcher" class="btn-switcher" id="aaa" data-input-id="c-switch" data-yes="1" data-no="0" >
                                <i class="fa fa-toggle-on text-success {eq name="$row.same_classroom" value="0"}fa-flip-horizontal text-gray{/eq} fa-2x"></i>
                            </a>                        </div>
                    </div>

                    <div class="form-group">
                        <label  class="control-label col-xs-12 col-sm-2">是否同一二级教学点:</label>
                        <div class="col-xs-12 col-sm-8" id="div-same_ocation" ><input  class="c-switch" name="row[same_ocation]" type="hidden" value="{$row.same_ocation}">
                            <a href="javascript:;" data-toggle="switcher" class="btn-switcher" data-input-id="c-switch" data-yes="1" data-no="0">
                                <i class="fa fa-toggle-on text-success {eq name="$row.same_ocation" value="0"}fa-flip-horizontal text-gray{/eq} fa-2x"></i>
                            </a>                        </div>
                    </div>

                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">是否能排在同一天:</label>
                        <div class="col-xs-12 col-sm-8" id="div-can_same_day" ><input  class="c-switch" name="row[can_same_day]" type="hidden" value="{$row.can_same_day}">
                            <a href="javascript:;" data-toggle="switcher" class="btn-switcher" data-input-id="c-switch" data-yes="1" data-no="0">
                                <i class="fa fa-toggle-on text-success {eq name="$row.can_same_day" value="0"}fa-flip-horizontal text-gray{/eq} fa-2x"></i>
                            </a>                        </div>
                    </div>

                    <div class="form-group">
                        <label for="c-daytime" class="control-label col-xs-12 col-sm-2">时段选择:</label>
                        <div class="col-xs-12 col-sm-8" id="div-daytime">
                            <?php $daytimeArray = explode(',', $row['daytime']);?>
                            <label for="row[daytime]-1">
                                <input id="row[daytime]-1" name="row[daytime][]" type="checkbox" readonly disabled
                                       value="1" <?php if(in_array(1, $daytimeArray)): ?>checked<?php endif; ?>/> 上午</label>
                            <label for="row[daytime]-2"><input id="row[daytime]-2" name="row[daytime][]" type="checkbox" readonly disabled
                                <?php if(in_array(2, $daytimeArray)): ?>checked<?php endif; ?>  value="2"/> 中午</label>
                            <label for="row[daytime]-3"><input id="row[daytime]-3" name="row[daytime][]" type="checkbox" readonly disabled
                                <?php if(in_array(3, $daytimeArray)): ?>checked<?php endif; ?>  value="3"/> 下午</label>
                            <label for="row[daytime]-4"><input id="row[daytime]-4" name="row[daytime][]" type="checkbox" readonly disabled
                                <?php if(in_array(4, $daytimeArray)): ?>checked<?php endif; ?>   value="4"/> 晚上</label>
                            <select  id="c-daytime-all"  style="display: none" multiple name="row[daytimeall][]" value="{$row.daytimeall}" class="form-control"  style="height:250px"  data-tip="时段选择"  >
                            </select>
                        </div>

                    </div>
                </fieldset>
                <fieldset>
                    <legend>班级信息</legend>
                   <div class="form-group">
                        <label for="c-bz" class="control-label col-xs-12 col-sm-2">备注:</label>
                        <div class="col-xs-12 col-sm-8" id="div-bz" >
                            <input type="text" id="c-bz" name="row[bz]" value="{$row.bz}" class="form-control" title="bz"  placeholder="" data-rule=""  data-tip="备注"  />
                        </div>
                   </div>

                   <div class="form-group">
                        <label for="c-status" class="control-label col-xs-12 col-sm-2">状态:</label>
                        <div class="col-xs-12 col-sm-8" id="div-status" >
                            <input id="c-status" name="row[status]" type="hidden" value="{$row.status}">
                            <a href="javascript:;" data-toggle="switcher" class="btn-switcher" data-input-id="c-status" data-yes="1" data-no="0">
                                <i class="fa fa-toggle-on text-success fa-flip-horizontal fa-2x"></i>
                            </a>
                            <div data-favisible="switch=1" class="p-3">已开户</div>                        </div>
                   </div>
                </fieldset>
                <div class="form-group layer-footer">
                    <label class="control-label col-xs-12 col-sm-2"></label>
                    <div class="col-xs-12 col-sm-8">
                        <button type="submit" class="btn btn-success btn-embossed">{:__('OK')}</button>
                        <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
                    </div>
                </div>
            </div>
            
        </div>
    </div>
</form>
<script>
    var app = new Vue({
        el: '#app',
        data: {
            leftOptions: Config.leftOptions,
            rightOptions: Config.rightOptions
        }
    });
</script>
